﻿<%@ Page Title="More details" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Details.aspx.vb" Inherits="BeachesInGreece.BeachDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
            <ItemTemplate><h2><i><%# Eval("BeachName") %></i></h2></ItemTemplate>
        </asp:Repeater>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BeachesDatabaseConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:BeachesDatabaseConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [BeachName] FROM [BeachesDatabase] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description">
                <ItemStyle HorizontalAlign="Justify" Width="400px" />
                </asp:BoundField>
                <asp:BoundField DataField="Review" HeaderText="Review" SortExpression="Review">
                <ItemStyle HorizontalAlign="Justify" Width="200px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Rating">
                    <ItemTemplate>
                        <img src='<%# getRating(Eval("UserRating")) %>'  alt="No picture found" width="90"  height="23"/>
                    </ItemTemplate>
                    <ItemStyle Width="100px" />
                </asp:TemplateField>
                <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture">
                    <ControlStyle BorderStyle="Double" Height="250px" Width="300px" />
                </asp:ImageField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BeachesDatabaseConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:BeachesDatabaseConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT [ID], [Description], [BeachName], [Review], [UserRating], [Picture] FROM [BeachesDatabase] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    
</asp:Content>
